package SentenceTranslator;

import Include.TACLine;
import Include.ASMConstructor;
import java.util.ArrayList;
import java.util.List;
import Main.SymbolManager;
import Common.REG;

public class RetTranslator {
    public List<String> SentenceTranslate(SymbolManager symbolManager, TACLine tacLine) {
        List<String> asmLines = new ArrayList<>();
        String strSrc1 = symbolManager.encodeVar(tacLine.src1.value);
        symbolManager.setEspBias(4);
        symbolManager.setAvalueMem(strSrc1, symbolManager.get_esp() - 4);
        asmLines.add(ASMConstructor.construct_asm("sub", REG.ESP, "4"));

        return asmLines;
    }
}
